package com.redoop.bigdatamaker.police;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintStream;

import com.redoop.bigdatamaker.utils.MakerUtils;
import com.redoop.bigdatamaker.utils.WhenUtils;
import com.redoop.bigdatamaker.utils.WhereUtils;
import com.redoop.bigdatamaker.utils.WhoUtils;

public class HotelMake {

	public static void main(String[] args) {

		String dataType = args[0];
		int count = Integer.parseInt(args[1]);
		System.out.println(dataType + "Maker:" + count);

		OutputStream out = null;
		BufferedWriter rd = null;
		try {
			out = new FileOutputStream("hotel.txt");
			rd = new BufferedWriter(new OutputStreamWriter(out, "utf-8"));
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}


		for (int i = 0; i < count; i++) {
			String name = MakerUtils.randomGet(MakerUtils.surname) + "" + MakerUtils.randomGet(MakerUtils.name);
			String sexNation = MakerUtils.randomGet(MakerUtils.sex) + "," + MakerUtils.randomGet(MakerUtils.nation);
			String card = WhoUtils.makeidCardNumber();
			String birthday = WhoUtils.randomBirthday();
			String address = MakerUtils.randomGet(MakerUtils.province);
			String rummery = WhereUtils.getName();
			String road = WhereUtils.getRoad();
			String contacts = MakerUtils.randomGet(MakerUtils.surname) + "" + MakerUtils.randomGet(MakerUtils.name);
			String time = WhenUtils.randomDate();
			String rome = WhereUtils.getRome();
			// 可以自动创建
			String s = i + "," + name + "," + card + "," + sexNation + "," + birthday + "," + address + "," + rummery
					+ "," + road + "," + contacts + "," + time + "," + rome;

			try {
				rd.write(s+"\n");

			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}

			System.out.println(i + "," + name + "," + card + "," + sexNation + "," + birthday + "," + address + ","
					+ rummery + "," + road + "," + contacts + "," + time + "," + rome);
		}

		try {
			rd.close();
			out.close();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}

}
